﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductRegPND.aspx.cs"
    Inherits="sWarranty.WEB.ProductRegPND" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="../UC/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../CSS/table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/Menu.css" />
    <link href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" rel="stylesheet"
        type="text/css" />
    <script src="../JS/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="../JS/jquery-ui.js" type="text/javascript"></script>
    <script src="../JS/Menu.js" type="text/javascript"></script>
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <script src="../JS/weekly_calendar/weeklycalendar.js" type="text/javascript"></script>
    <link href="../JS/weekly_calendar/calendar.css" rel="stylesheet" type="text/css" />
    <link href="../JS/chosen-master/chosen/chosen.css" rel="stylesheet" type="text/css" />
    <script src="../JS/chosen-master/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script src="../JS/jquery.stickytableheaders.js" type="text/javascript"></script>
    <link href="../JS/chosen-master/chosen/chosen.css" rel="stylesheet" type="text/css" />
    <script src="../JS/chosen-master/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#txtFromDate").attr('readOnly', 'true');
            $("#txtToDate").attr('readOnly', 'true');
            //$("table").stickyTableHeaders();
            SetLogger();
        });
        
        buildWeeklyCalendar(1);

    </script>
    <style type="text/css">
        .style1
        {
            width: 63px;
        }
    </style>
    <script type="text/javascript">
        function openPopUp(popUrl, type) {
            var name = 'popUp';
            var appearence = 'dependent=no,menubar=no,resizable=yes,' +
                  'status=yes,toolbar=yes,titlebar=no,' +
                  'width=' + window.screen.availWidth * 80 / 100 + ', height=' + window.screen.availHeight * 80 / 100 + ',resizable=yes,center=yes';
            var openWindow = '';
            if (type == 'open')
                openWindow = window.open(popUrl, name, appearence);
            if (type == 'popup')
                openWindow = window.showModalDialog(popUrl, name, appearence);
            openWindow.focus();
            return false;
        }

        function OnRowDblClick(sender, eventArgs) {
            var dataItem = $get(eventArgs.get_id());
            var grid = sender;
            var MasterTable = grid.get_masterTableView();
            var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
            var cell = MasterTable.getCellByColumnUniqueName(row, "SERIAL_NO");
            var value = cell.innerHTML;
            value = value.replace("<nobr>", "");
            value = value.replace("</nobr>", "");
            value = value.replace("<NOBR>", "");
            value = value.replace("</NOBR>", "");
            openPopUp('ProductRegPndQue.aspx?sn=' + value, 'open');
        }   
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ksdjfl" runat="server">
    </asp:ScriptManager>
    <uc1:Header ID="Header1" runat="server" />
    <div class="Mid">
        <div class="Mid1">
            <div id="DataContent">
                <%-- <div>
                    Nội dung bên trái
                </div>--%>
                <div>
                    <div class="TitleTab">
                        <ul>
                            <li><a href="ProductRegPND.aspx" class="TitleTab_act">Sell-Out</a></li>
                            <li><a href="ProductRegPndW.aspx">Warranty</a></li>
                        </ul>
                    </div>
                    <!-- DataGrid Start -->
                    <div class="Search">
                        <table>
                            <tr>
                                <td style="background-color: #F7F7F7">
                                    Period :
                                </td>
                                <td>
                                    <asp:TextBox ID="txtFromDate" runat="server" Width="70px" Enabled="true"></asp:TextBox>
                                    <asp:TextBox ID="txtToDate" runat="server" Width="70px" Enabled="true"></asp:TextBox>
                                    <input type="button" value="..." onclick="w_displayCalendar('txtFromDate','txtToDate');" />
                                </td>
                                <td style='width: 5px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    Region :
                                </td>
                                <td>
                                    <asp:DropDownList ID="dropRegion" Width="90%" runat="server" CssClass="chzn-select"
                                        data-placeholder="..All..">
                                        <asp:ListItem Value="00" Text="-- Select --"></asp:ListItem>
                                        <asp:ListItem Value="01" Text="NORTH"></asp:ListItem>
                                        <asp:ListItem Value="02" Text="MIDDLE"></asp:ListItem>
                                        <asp:ListItem Value="03" Text="SOUTH"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td style='width: 5px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    By SMS :
                                </td>
                                <td>
                                    <asp:DropDownList ID="dropBySMS" runat="server" CssClass="chzn-select" data-placeholder="..All..">
                                        <asp:ListItem Value="0" Text="ALL"></asp:ListItem>
                                        <asp:ListItem Value="Y" Text="Y"></asp:ListItem>
                                        <asp:ListItem Value="N" Text="N"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td style='width: 5px'>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td style="background-color: #F7F7F7">
                                    Model
                                </td>
                                <td>
                                    <asp:TextBox ID="txtModel" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td style='width: 5px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    Shop Name :
                                </td>
                                <td>
                                    <asp:TextBox ID="txtShopName" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td style='width: 5px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    Serial
                                </td>
                                <td>
                                    <asp:TextBox ID="txtSerial" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td style='width: 5px'>
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="btnExcel" runat="server" OnClick="btnExcel_Click" Width="80px" CssClass="button Float-right"
                                        Text="Export" />
                                    <asp:Button ID="btnSearch" runat="server" Width="80px" CssClass="button" Text="Search"
                                        OnClick="btnSearch_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divScroll" style="overflow: auto;">
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
                            OnGroupsChanging="RadGrid1_GroupsChanging" CssClass="RadGridCustomClass" GridLines="None"
                            ShowGroupPanel="True" OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Office2007" 
                            OnColumnCreated="RadGrid1_ColumnCreated" 
                            OnItemDataBound="RadGrid1_ItemDataBound" onitemcreated="RadGrid1_ItemCreated">
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="true" ReorderColumnsOnClient="True">
                                <ClientEvents OnRowDblClick="OnRowDblClick" />
                                <ClientEvents />
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <MasterTableView>
                                 <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="SHOP_NAME"></telerik:GridGroupByField>
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="SHOP_NAME" HeaderText="SHOP_NAME"></telerik:GridGroupByField>
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                                <PagerStyle AlwaysVisible="True" />
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>
                    </div>
                    <!-- DataGrid End -->
                </div>
            </div>
            <div class="Clear_both">
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(".chzn-select").chosen();
    </script>
    </form>
</body>
</html>
